<template>
    <div class="row border-bottom">
        <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
            <div class="navbar-header">
                <a class="navbar-minimalize minimalize-styl-2 btn btn-primary" href="#"
                   style="background: #444 !important;border: 2px solid #fff !important">
                    <i class="fa fa-bars"></i>
                </a>
            </div>
            <!-- <ul class="nav navbar-top-links navbar-right">
                 <li class="dropdown">
                     <a href="javaScript:void(0)" @click="userLogout" class="">
                         <i class="fa fa fa-sign-out"></i>
                         个人信息
                     </a>
                 </li>
             </ul>-->
            <ul class="nav navbar-top-links navbar-right">
                <li class="dropdown">
                    <a href="javaScript:void(0)" @click="userLogout" class="">
                        <i class="fa fa fa-sign-out"></i>
                        退出
                    </a>
                </li>
            </ul>
        </nav>
    </div>
</template>

<script>
    export default {
        name: 'TopHeader',
        data() {
            return {}
        },
        mounted() {
        },
        methods: {
            async userLogout() {
                let res = await this.$api.put('/sys/logout', {});
                if (res.code === 0) {
                    this.$delCookie('token');
                    this.$message.success(res.msg);
                    this.$router.push({path: '/login'});
                } else {
                    this.$message.error(res.msg);
                }
            },
        }
    }
</script>

<style>
</style>
